<!DOCTYPE html>
<html   lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="博客,论坛,社区,个人博客,技术社区,技术论坛,开源博客,开源社区,开源论坛">
  <meta name="description" content="博客,论坛,社区,个人博客,技术社区,技术论坛,开源博客,开源社区,开源论坛">

  <meta name="csrf-token" content="oeCerWkOzAQUDx6XlKX456luUrHKxlDGsPcZISzN">
  <title>Free社区</title>
    <link rel="stylesheet" th:href="@{/forum/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/forum/css/global.css}">
    <script  th:src="@{/forum/layui/layui.js}"></script>
    <script  th:src="@{/forum/js/jquery.min.js}"></script>
    <script  th:src="@{/forum/js/common.js}"></script>
  <script type="text/javascript">
    
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?57c0470fa39f9e617c2771d0d95c3758";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
    
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
      }
      else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
      }
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();

    
    $.ajaxSetup({
      headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
      }
    });
  </script>

  </head>
<body>

  <div class="fly-header layui-bg-black">
    <div class="layui-container">
        <a class="fly-logo" href="https://www.freees.cn">
            <img src="https://www.freees.cn/images/blog/logo.png">
        </a>
        <ul class="layui-nav fly-nav layui-hide-xs">
            <li class="layui-nav-item layui-this">
                <a href="https://www.aliyun.com/minisite/goods?userCode=0cxpuaw8" target="_blank"><i class="iconfont icon-iconmingxinganli"></i>阿里云</a>
            </li>
            <li class="layui-nav-item">
                <a target="_blank" href="https://url.cn/5kWvkCx"><i class="iconfont icon-jiaoliu"></i>腾讯云</a>
            </li>
        </ul>

        <ul class="layui-nav fly-nav-user">
                            <!-- 未登入的状态 -->
                    <li class="layui-nav-item">
                        <a class="iconfont icon-touxiang layui-hide-xs" href="login"></a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="https://www.freees.cn/login">登入</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="https://www.freees.cn/register">注册</a>
                    </li>
                    </ul>
    </div>
</div>
    <div class="fly-panel fly-column">
    <div class="layui-container">
      <ul class="layui-clear">
        <li class="layui-hide-xs"><a href="/">首页</a></li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=1&amp;create_time=desc">
              PHP
              <span class="layui-badge-dot"></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=2&amp;create_time=desc">
              JAVA
              <span class=""></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=3&amp;create_time=desc">
              GO
              <span class=""></span>
            </a>
          </li>
                  <li  class="layui-this" >
            <a href="https://www.freees.cn/article_list?nav_id=4&amp;create_time=desc">
              Linux
              <span class=""></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=5&amp;create_time=desc">
              前端
              <span class=""></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=6&amp;create_time=desc">
              数据库
              <span class=""></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=7&amp;create_time=desc">
              其他
              <span class=""></span>
            </a>
          </li>
                  <li >
            <a href="https://www.freees.cn/article_list?nav_id=8&amp;create_time=desc">
              建议
              <span class="layui-badge-dot"></span>
            </a>
          </li>
                <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li>
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="https://www.freees.cn/my_article">我发表的贴</a></li>
        
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"> <input id="search_content" type="text" style="border: none;height: 20px"></li>
        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
          <span class="fly-search" id="search"><i class="layui-icon"></i></span>
        </li>
      </ul>

      <div class="fly-column-right layui-hide-xs">
        <a href="https://www.freees.cn/add_article" class="layui-btn">发表新帖</a>
      </div>
      <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
        <a href="https://www.freees.cn/add_article" class="layui-btn">发表新帖</a>
      </div>
    </div>
  </div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1>Linux环境搭建svn服务</h1>
        <div class="fly-detail-info">
          <span class="layui-badge layui-bg-green fly-detail-column">Linux</span>
                    <span class="layui-badge layui-bg-black">置顶</span>
                              <span class="fly-list-nums">
                          <a href="javascript:void(0);" class="layui-badge" id="collect" style="background: #c6c6c6">收藏</a>
                        <a href="#comment"><i class="iconfont" title="评论">&#xe60c;</i> 1</a>
            <i class="iconfont" title="人气">&#xe60b;</i> 146
          </span>
        </div>
        <div class="detail-about" style="line-height: 45px;">
          <a class="fly-avatar" href="https://www.freees.cn/user_home?user_no=U5d1d4cea94aebcc75b">
            <img src="https://www.freees.cn/images/blog/face_free.jpg">
          </a>
          <div class="fly-detail-user">
            <a href="https://www.freees.cn/user_home?user_no=U5d1d4cea94aebcc75b" class="fly-link">
              <cite>FREE</cite>
              <i class="iconfont icon-renzheng"></i>
              <i class="layui-badge fly-badge-vip">VIP</i>
            </a>
            <span>2019-07-07 11:21:11</span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="123">
          </div>
        </div>
        <div class="detail-body photos d_content">
          






<p class="MsoNormal"><span>1.<font face="宋体">检查</font><font face="Calibri">svn</font><font face="宋体">是否存在：

</font></span></p><p class="MsoNormal"><span><font face="宋体"><pre lay-lang="JavaScript">svnserve --

version</pre></font></span><p><span><font face="宋体">2.</font></span><span>.</span><font face="宋体">安装：

</font></p><p><font face="宋体"><pre lay-lang="JavaScript">yum install -y subversion</pre></font><p><font face="宋

体">3.</font><span>是否安装成功：</span></p><p><span><pre lay-lang="JavaScript">svnserve --

version</pre></span><p><span>4.</span><span>.</span><font face="宋体">创建</font><font face="Calibri">svn</font><font face="宋

体">资源仓库（配置文件自动生成）：</font></p><p><font face="宋体"><pre lay-lang="JavaScript">svnadmin create /svndir 

</pre></font><p class="MsoNormal"><span><font face="宋体">（</font>svn<font face="宋体">目录名称，自己起，注意不是</font><font 

face="Calibri">web</font><font face="宋体">目录，后面需要做同步）</font></span></p><p class="MsoNormal"><span><font face="宋体

"><br></font></span></p><p class="MsoNormal"><span><font face="宋体">5.进入到资源仓库查看文件</font></span></p><p 

class="MsoNormal"><span></span></p></p><pre lay-lang="JavaScript">cd /svndir
ls</pre><p 

class="MsoNormal"><span></span><span></span></p></p><p class="MsoNormal"><span>authz #<font face="宋体">权限配置文

件 </font></span><span><br></span><span>	</span><span>passwd #<font face="宋体">用户名密码文件 

</font></span><span><br></span><span>	</span><p><span>svnserve.conf #<font face="宋体">资源库配置文件

</font></span></p><p><span><font face="宋体"><br></font></span></p><p class="MsoNormal"><span>6.<font face="宋体">创建用户密码

：</font><font face="Calibri">vim passwd</font></span><span></span></p></p><p class="MsoNormal"><span><font face="

宋体">新增：</font>lsq = qaz123</span><span></span></p><p class="MsoNormal"><span><br></span></p><p 

class="MsoNormal"><span>7.</span><span><font face="宋体">打开权限配置文件：</font>vim authz</span></p><p 

class="MsoNormal"><span><img src="http://www.freees.cn/upload/article/J2o4m1vRVaY8uAsRbKqOa6pNaTnuugO0A8rMLBVk.png" 

alt="undefined"><br></span></p><p class="MsoNormal"><span><br></span></p><p>报错Authorization failed；把[web-svn:/]改为[/]

</p><p class="MsoNormal"><span>8.</span><span>&nbsp;</span><span><font face="宋体">打开资源库配置文件</font>svenserve<font 

face="宋体">，并打开配置</font></span></p></p><p class="MsoNormal"></p></p><p class="MsoNormal"><span>anon-access = 

none </span><span>#<font face="宋体">没有登录的用户不能访问</font></span><span><br></span><span>	</span><span>auth-

access = write </span><span>#<font face="宋体">登录的用户可以写入</font></span><span><br></span><span>	

</span><span>password-db = passwd </span><span>#<font face="宋体">密码文件为当前目录下的</font><font 

face="Verdana">passwd</font></span><span><br></span><span>	</span><span>authz-db = authz </span><span>#<font face="宋体">

验证文件为当前目录下的</font><font face="Verdana">authz</font></span><span></span></p><p 

class="MsoNormal"><span>realm = /</span><span>home</span><span>/</span><span>www</span><span><font face="宋体">：指定认证域

</font></span><span></span></p><p class="MsoNormal"><br></p><p class="MsoNormal">9.<span>启动或重启服务：

</span></p><p class="MsoNormal"><span></span></p><pre lay-lang="JavaScript">ps -ef|grep svn
kill -9&nbsp;
svnserve -d -r 

/home/www</pre><p class="MsoNormal"><span></span><span></span></p><p class="MsoNormal"><span><font face="宋体">（安

装目录的上一级目录</font>,<font face="宋体">不知道为什么没如果用</font><font face="Calibri">svnserve -d -r /home/www/wen-

svn</font><font face="宋体">目</font></span><span>	</span><span><font face="宋体">录启动，客户端就会报错，无法启动，下面

开机自启同样</font>/home/www<font face="宋体">）</font></span><span></span></p><p class="MsoNormal"><span><font 

face="宋体"><br></font></span></p><p class="MsoNormal"><font face="宋体">可能会出现的错误</font></p><p 

class="MsoNormal"><span>1.svn<font face="宋体">连接报错 </font><font face="Calibri">Can't connect to host '*.*.*.*': 

</font><font face="宋体">由于连接方在一段时间后没有正确答复或</font></span><span>连接的主机没有响应，连接尝试失败。

</span></p><p class="MsoNormal"><span>解决：依次输入命令：</span><span></span></p><p class="MsoNormal"><span><pre 

lay-lang="JavaScript">/sbin/iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
/etc/init.d/iptables save
service iptables 

restart</pre></span><p><span>2.</span><span>认证配置无效</span></p></p><p class="MsoNormal"><span><font face="宋体">解决：

</font>authz<font face="宋体">文件寻找错误</font></span><span></span></p><p class="MsoNormal"><span><font face="宋

体"><br></font></span></p><p class="MsoNormal"><b><span>Svn <font face="宋体">自动同步到 </font><font 

face="Calibri">web</font></span></b><b><span></span></b></p><p class="MsoNormal">1.<font face="宋体">导出一份文件到

</font><font face="Calibri">web</font><font face="宋体">目录</font><b><span></span></b></p><p 

class="MsoNormal"><font face="宋体"><pre lay-lang="JavaScript">svn co file:///home/www/web-svn/ 

/home/www/web/</pre></font><p><font face="宋体">2.编辑shell脚本</font></p><p><font face="宋体"><pre lay-lang="JavaScript">cd 

/home/www/web-svn/hooks/
vi &nbsp;post-commit</pre></font><p><font face="宋体"><img 

src="http://www.freees.cn/upload/article/hLoc3SSey4GGd3GcGekf6SwjRXjgSI6mJ4ylLLzo.png" alt="undefined"></font></p><p>第二

种方法：</p>
<p>#!/bin/sh</p>
<p>export LANG=en_US.utf8</p>
<p>svn update /home/www/blog/ --username '你的账户' --password '你的密码' --no-auth-cache</p><p class="MsoNormal"><span><font 

face="宋体">赋值</font>755<font face="宋体">权限</font></span></p><p class="MsoNormal"><span><font face="宋体"><pre lay-

lang="JavaScript">chmod +x post-commit</pre></font></span><p class="p"><span><font face="宋体">修改</font>post-commit<font 

face="宋体">用户为</font></span><span>web</span><span><font face="宋体">目录用户</font></span><span>(ll<font face="宋体">可查

看目录</font></span><span>	</span><span><font face="宋体">所有者</font>)

</span><b><span></span></b></p></p></p></p><p class="MsoNormal"><b><span><font face="Calibri"><pre lay-

lang="JavaScript">chown root:root&nbsp;post-commit</pre></font></span></b><p class="p"><b><span><font face="宋

体"><br></font></span></b></p><p class="p"><b><span><font face="宋体">同步结束

</font></span></b><b><span></span></b></p><p class="p"><b><span><font face="宋体">开机自动启动</font>SVN<font 

face="宋体">（</font><font face="Verdana">centos7</font><font face="宋体">不可用）

</font></span></b><b><span></span></b></p><p class="p"><pre lay-lang="JavaScript">vi /etc/rc.d/rc.local </pre><p 

class="MsoNormal"><span>(</span><span><font face="微软雅黑">这个配置文件会在用户登陆之前读取，这个文件中写入了什么命令，在每次

系统启动时都会执行一</font></span><span>	</span><span><font face="微软雅黑">次。也就是说，如果有任何需要在系统启动时运

行的工作，则只需写入</font> /etc/rc.d/rc.local 配置文件</span><span>	</span><span><font face="微软雅黑">即可。

</font></span><span>)</span><span></span></p><p class="MsoNormal"><span><br></span></p><p 

class="MsoNormal"><span>/usr/bin/svnserve -d -r /home/</span><span>www #在文件中加入</span></p><p class="MsoNormal"><span>

(</span><span><font face="微软雅黑">我们在用终端操作的时候，可以直接使用以下命令启动</font>SVN：</span><span>svnserve -d -r 

/home/svn&nbsp;但是在/etc/rc.d/rc.local 文件中必须写上完整的路径！</span><span>W</span><span>hereis svnserve 命令 可以查看位置

</span><span>)</span><span></span></p></p><p class="MsoNormal"><span>chmod 777 

</span><span>/etc/rc.d/rc.local</span><span>&nbsp;#加权限</span><span></span></p><p 

class="MsoNormal"><span><br></span></p><p class="MsoNormal"><b><span><font face="宋体">开机自动启动</font>svn 

centos7</span></b><b><span></span></b></p><p class="MsoNormal"><b><span><pre lay-lang="JavaScript">vim 

/etc/sysconfig/svnserve</pre></span></b></p></p><p class="MsoNormal"><span>OPTIONS="-r 

/home/www"</span><span></span></p><p class="MsoNormal"><span>&nbsp;(注意目录，我的svn目录是/home/www/web-svn,加上

web-svn也可以</span><span>	</span><span><font face="微软雅黑">启动，但是上面不一样</font>svn无法使用)

</span><span></span></p><p class="MsoNormal"><p><span><font face="微软雅黑">启动</font>svnserve服务

</span></p><p><span><pre lay-lang="JavaScript">systemctl start svnserve.service</pre></span></p><span>	</span><span><font 

face="微软雅黑">设置开机自启动</font></span><span><br></span><pre lay-lang="JavaScript">systemctl enable 

svnserve.service</pre></p><p class="MsoNormal"><span><font face="微软雅黑">查看服务当前状态</font></span><span><br></span><pre 

lay-lang="JavaScript">systemctl status svnserve.service</pre><br></p>
        </div>
      </div>

      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>评论</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
                              <li data-id="111" class="jieda-daan">
            <a name="item-1111111111"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img src="https://www.freees.cn/upload/face_img/default_face_img2.png" alt=" ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite class="nick_name">吴彦祖</cite>
                  <i class="iconfont icon-renzheng" ></i>
                  <i class="layui-badge fly-badge-vip">VIP</i>
                </a>
                              </div>

              <div class="detail-hits">
                <span>2019-07-04 10:18:58</span>
              </div>
            </div>
            <div class="detail-body jieda-body photos">
              <p>楼王的文档写的很细致哦<img src="https://www.freees.cn/layui/images/face/54.gif" alt="[good]"></p>
            </div>
            <div class="jieda-reply">
                              <span class="jieda-zan" type="zan" onclick="zan(1,this)">
                <i class="iconfont icon-zan"></i>
                  <em>1</em>
                </span>
              
              <span type="reply" class="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
              <div class="jieda-admin">
                <!-- <span type="del">删除</span>-->
                <!-- <span class="jieda-accept" type="accept">采纳</span> -->
              </div>
            </div>
            <input id="comment_user_id" type="hidden" value="2">
          </li>
                            </ul>
        
        <div class="layui-form layui-form-pane">
          <form  method="post">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content"  placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="article_id" value="2">
              <input type="hidden" id="reply_user_id" name="reply_user_id" value="0">
              <input type="hidden" id="reply_nick_name" name="reply_nick_name" value="">
              <button class="layui-btn" lay-filter="add" lay-submit>提交评论</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">

  <div class="fly-panel">
    <h3 class="fly-panel-title">温馨通道</h3>
    <ul class="fly-panel-main fly-list-static">
                        <li>
                <a  href="javascript:;" id="getAisle"  >代码开源 GitHub 通道，欢迎下载指正</a>
            </li>
                    <li>
                <a  href="javascript:;" id="getAisle"  >代码开源 Gitee 通道，欢迎下载指正</a>
            </li>
            </ul>
  </div>

  <div class="fly-panel fly-rank fly-rank-reply" id="">
    <h3 class="fly-panel-title">发贴榜</h3>
    <dl>
              <dd>
          <a href="https://www.freees.cn/user_home?user_no=U5d3204aa4f73ce376e">
            <img src="https://www.freees.cn/upload/face_img/default_face_img4.png"><cite>chenchen</cite><i>发帖1次</i>
          </a>
        </dd>
              <dd>
          <a href="https://www.freees.cn/user_home?user_no=U5d1d4cea94aebcc75b">
            <img src="https://www.freees.cn/images/blog/face_free.jpg"><cite>FREE</cite><i>发帖16次</i>
          </a>
        </dd>
              <dd>
          <a href="https://www.freees.cn/user_home?user_no=U5d3150838ab100d0b4">
            <img src="https://www.freees.cn/upload/face_img/default_face_img2.png"><cite>Roderick</cite><i>发帖2次</i>
          </a>
        </dd>
              <dd>
          <a href="https://www.freees.cn/user_home?user_no=U5d3153edcd879b8d9b">
            <img src="https://freees.cn/upload/face_img/ffZseFVQzXMkOvwdSywIZeXK11aDeFUeACz6JVKX.jpeg"><cite>闹钟</cite><i>发帖1次</i>
          </a>
        </dd>
          </dl>
  </div>


  <dl class="fly-panel fly-list-one">
    <dt class="fly-panel-title">热议</dt>
              <dd>
          <a href="https://www.freees.cn/article_detail?article_id=2&amp;nav_id=4">Linux环境搭建svn服务</a>
          <span style="float: right"><i class="iconfont icon-pinglun1"></i> 1</span>
        </dd>
              <dd>
          <a href="https://www.freees.cn/article_detail?article_id=9&amp;nav_id=1">thinkphp运用elasticsearch</a>
          <span style="float: right"><i class="iconfont icon-pinglun1"></i> 1</span>
        </dd>
              <dd>
          <a href="https://www.freees.cn/article_detail?article_id=12&amp;nav_id=5">windows下flutter开发环境安装</a>
          <span style="float: right"><i class="iconfont icon-pinglun1"></i> 1</span>
        </dd>
        </dl>

    <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <div id="container" style="width:320px;height: 288px;margin: auto"></div>
    </div>

    <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <img src="https://www.freees.cn/images/blog/wx_qrcode.jpg" style="max-width: 100%;" alt="layui">
        <p style="position: relative; color: #666;">FREE社区订阅号</p>
    </div>

    <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <img src="https://www.freees.cn/images/blog/mini_code.jpg" style="max-width: 100%;" alt="layui">
        <p style="position: relative; color: #666;">FREE社区小程序</p>
    </div>



  <div class="fly-panel fly-link">
    <h3 class="fly-panel-title">友情链接</h3>
    <dl class="fly-panel-main">
                    <dd><a href="http://www.layui.com/" target="_blank">layui</a><dd>
                    <dd><a href="https://www.hxxzt.com/" target="_blank">南风知我意</a><dd>
                    <dd><a href="https://url.cn/5kWvkCx" target="_blank">腾讯云</a><dd>
                    <dd><a href="https://www.aliyun.com/minisite/goods?userCode=0cxpuaw8" target="_blank">阿里云</a><dd>
            </dl>
  </div>
</div>
<script  src="https://www.freees.cn/js/echarts.min.js"></script>
<script  src="https://www.freees.cn/js/china.js"></script>
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    option = {
        title : {
            text: 'FREE用户分布图',
            subtext: '写死的假数据',
            left: 'center',

        },
        tooltip : {
            trigger: 'item',
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data:['']
        },
        visualMap: {
            min: 0,
            max: 100,
            show: true,
            orient : 'horizontal',//颜色条方向horizontal vertical
            text:['max','min'],// 文本，默认为数值文本
            calculable : false,
            color: ['#01AAED', '#88ceea', '#cfedf9']
        },
        toolbox: {
            show: false,//工具
        },
        series : [
            {
                name: '人数',
                type: 'map',
                mapType: 'china',
                roam: false,
                label: {
                    normal: {
                        show: false
                    },
                    emphasis: {
                        show: false
                    }
                },
                showLegendSymbol: false,
                data:[
                    {name: '新疆',value: 1},
                    {name: '江苏',value: 80},
                    {name: '湖南',value: 20},
                    {name: '辽宁',value: 30},
                    {name: '广州',value: 40},
                    {name: '陕西',value: 16},
                    {name: '黑龙江',value: 8},
                    {name: '四川',value: 56},
                    {name: '台湾',value: 56},
                    {name: '海南',value: 2},
                    {name: '北京',value: 12},
                    {name: '浙江',value: 50}
                ],

            }
        ]
    };
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
</script>
  </div>
</div>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  <script>
    layui.use("layer",function(){
      //相册层
      $(".d_content img").click(function () {
        var start = $(".d_content img").index(this);
        var json = {
          start: start,
          data: getPictureURL()
        }
        layer.photos({
          photos: json //格式见API文档手册页
          ,anim: 4 //0-6的选择，指定弹出图片动画类型，默认随机
        });
      });
    })

    function getPictureURL(){
      var photos = new Array();
      $(".d_content img").each(function(index){
        var photo = {
          pid: index,
          src: $(this).attr("src"),
          thumb: ''
        }
        photos.push(photo);
      });
      return photos;
    }

    layui.use('layedit', function(){
      var layedit = layui.layedit,
              form = layui.form;
      layedit.set({
        uploadImage: {
          url: 'https://www.freees.cn/upload_image' //接口url
          ,type: 'post' //默认post
        }
      });
      var index = layedit.build('L_content',{
        tool: [
          'code' //插入代码
          ,'image' //插入图片
          ,'strong' //加粗
          ,'left' //左对齐
          ,'center' //居中对齐
          ,'right' //右对齐
          ,'link' //超链接
          ,'face' //表情

        ]
      }); //建立编辑器
      //将富文本内容同步到表单,否则无法获取
      form.verify({
        content:function () {
          return layedit.sync(index);
        }
      });
      form.on('submit(add)', function(data){
        data.field['content'] = layedit.getContent(index);
        $.post("https://www.freees.cn/add_comment",data.field,function(res){
          if(res.code == '1'){
            layer.msg(res.msg, {icon: 1},function () {
              window.location.reload();
            });
          }else if(res.code == -1){
            window.location.href="https://www.freees.cn/login"
          }else if(res.code == -2){
            window.location.href="https://www.freees.cn/check_email"
          }else{
            layer.msg(res.msg, function () {
              //window.location.reload();
            });
          }
        },'json');
        return false;
      });

      $(document).on('click','#search',function(){
        var content = $('#search_content').val();
        window.location.href = "article_list?title="+content;
      });

      $(document).on('click','.reply',function(){
        var reply_nick_name =  $(this).parents('li').find('.nick_name').html();
        layedit.setContent(index, '@'+reply_nick_name+'&nbsp;&nbsp;');
        var reply_user_id =  $(this).parents('li').find('#comment_user_id').val();
        $("#reply_user_id").val(reply_user_id);
        $("#reply_nick_name").val(reply_nick_name);

      });

      $(document).on('click','#collect',function(){
        var name = $(this).html();
        if(name == '已收藏'){
          $(this).removeClass('layui-bg-blue');
          $(this).css('background','#c6c6c6');
          $(this).html('收藏');
        }else{
          $(this).addClass('layui-bg-blue');
          $(this).html('已收藏');
        }
        $.post("https://www.freees.cn/collect",{'article_id':2},function(res){
          if(res.code == '1'){
            layer.msg(res.msg, {icon: 1},function () {
              //window.location.reload();
            });
          }else if(res.code == -1){
            window.location.href="https://www.freees.cn/login"
          }else if(res.code == -2){
            window.location.href="https://www.freees.cn/check_email"
          }else{
            layer.msg(res.msg, function () {
              //window.location.reload();
            });
          }
        },'json');
      });
    });
    
    function zan(id,obj) {
      var cla = $(obj).attr('class');
      var num = $(obj).find('em').html();
      if(cla == 'jieda-zan'){
        $(obj).addClass('zanok');
        $(obj).find('em').html(Number(num)+Number(1));
        $.get("https://www.freees.cn/zan",{'id':id},function(res){
          res = $.parseJSON(res);
            if(res.code == 2){
              layer.msg(res.msg, function () {
              });
            }else if(res.code == -1){
              window.location.href="https://www.freees.cn/login"
            }else if(res.code == -2){
              window.location.href="https://www.freees.cn/check_email"
            }
        });
      }else{
        layer.msg('你已经点过赞了', function () {
        });
      }
    }

    wx.config({
      debug: false,
      appId: 'wx2d3c9ef21793cba2',
      timestamp:'1578736077',
      nonceStr: 'vTcwzizWjdNqxtxa',
      signature: '152ff0fafd105214354ce927beb66c83725127fc',
      jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage']
    });
    wx.ready(function () {
      wx.onMenuShareAppMessage({
        title: 'Linux环境搭建svn服务',
        desc: '',
        link: 'https://www.freees.cn/article_detail?article_id=2&amp;nav_id=4',
        imgUrl: 'https://www.freees.cn/images/blog/face_free.jpg',
        success: function () {
          // 设置成功
        }
      })
      wx.onMenuShareTimeline({
        title: 'Linux环境搭建svn服务',
        link: 'https://www.freees.cn/article_detail?article_id=2&amp;nav_id=4',
        imgUrl: 'https://www.freees.cn/images/blog/face_free.jpg',
        success: function () {
          // 设置成功
        }
      })
    });
  </script>


  <div class="fly-footer">
    <p><a href="#" >Free社区</a> 2019 &copy; <a href="#" target="_blank">freees.cn 出品</a>
    <a href="http://beian.miit.gov.cn" target="_blank" rel="nofollow">苏ICP备19038100号-1</a></p>
</div>

</body>
</html>